﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using Model.App_GlobalResources;
using System.Web.Mvc;

namespace Model.Models

{
    public class Empresa
    {
        [Required]
        public int Id_Empresa { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resource_br_pt), ErrorMessageResourceName = "NomeEmpresaRequerido")]
        [StringLength(40, MinimumLength = 3)]
        [Display(Name = "Nome")]
        public string Nome { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resource_br_pt), ErrorMessageResourceName = "CnpjRequerido")]
        [StringLength(18, MinimumLength = 3)]
        [RegularExpression(@"^\d{2}.\d{3}.\d{3}/\d{4}-\d{2}?$", ErrorMessage = "Cnpj inválido.")]
        [Display(Name = "CNPJ")]
        public string Cnpj { get; set; }


        [Required(ErrorMessageResourceType = typeof(Resource_br_pt), ErrorMessageResourceName = "EmailRequerido")]
        [StringLength(40, MinimumLength = 7)]
        [RegularExpression(@"^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$", ErrorMessage = "Digite um email válido")]
        [Display(Name = "Email")] 
        public string Email { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resource_br_pt), ErrorMessageResourceName = "SenhaRequerido")]
        [StringLength(30, MinimumLength = 6)]
        [Display(Name = "Senha")] 
        public string Senha { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resource_br_pt), ErrorMessageResourceName = "ConfirmaSenhaRequerido")]
        [StringLength(30, MinimumLength = 6)]
        [Compare("Senha")]
        [Display(Name = "Confirmar Senha")]  
        public string ConfirmaSenha { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resource_br_pt), ErrorMessageResourceName = "TelefoneRequerido")]
        [StringLength(11, MinimumLength = 8)]
        [Display(Name = "Telefone")]
        public string Telefone { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resource_br_pt), ErrorMessageResourceName = "RazaoSocialRequerido")]
        [StringLength(25, MinimumLength = 3)]
        [Display(Name = "Razão Social")]
        public string RazaoSocial { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resource_br_pt), ErrorMessageResourceName = "RuaRequerido")]
        [StringLength(30, MinimumLength = 3)]
        [Display(Name = "Rua")]
        public string Rua { get; set; }
        
        [Required(ErrorMessageResourceType = typeof(Resource_br_pt), ErrorMessageResourceName = "NumeroRequerido")]
        [StringLength(5)]
        [Display(Name = "Numero")]
        [RegularExpression(@"^(\d)*?$", ErrorMessage = "Número inválido.")]
        public String Numero { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resource_br_pt), ErrorMessageResourceName = "BairroRequerido")]
        [StringLength(20, MinimumLength = 4)]
        [Display(Name = "Bairro")]
        public string Bairro { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resource_br_pt), ErrorMessageResourceName = "CepRequerido")]
        [StringLength(9, MinimumLength = 8)]
        [RegularExpression(@"^\d{5}-\d{3}?$", ErrorMessage = "Cep inválido.")]
        [Display(Name = "Cep")]
        public string Cep { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resource_br_pt), ErrorMessageResourceName = "CidadeRequerido")]
        [StringLength(30, MinimumLength = 4)]
        [Display(Name = "Cidade")]
        public string Cidade { get; set; }
        
        [Display(Name = "Estado")]// COMBO BOX NA TELA (SE) setado POR PADÃRO
        public string Estado { get; set; }

       
    }
}
